package com.objetdirect.gwt.umldrawer.shared.dto;

import java.io.Serializable;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.Table;

@Entity
@Table(name = "project")
public class ProjectDto implements Serializable {

	private static final long serialVersionUID = 406490697899314586L;

	@Id
	@Column(nullable = false, unique = true, name = "project_id")
	@GeneratedValue(strategy = GenerationType.AUTO)
	int projectId;

	@Column(name = "project_name", length = 200)
	String projectName;

	@Column(name = "project_type", length = 50)
	String projectType;

	@Column(name = "project_admin_email", length = 200)
	String ProjectAdminMail;

	@JoinTable(name = "Project_developer", joinColumns = @JoinColumn(name = "project_id"), inverseJoinColumns = @JoinColumn(name = "developer_id"))
	@ManyToMany(fetch = FetchType.LAZY)
	private List<DeveloperDto> developers;

	public ProjectDto() {
	}

	public ProjectDto(int projectId) {
		super();
		this.projectId = projectId;
	}

	public ProjectDto(int projectId, String projectName, String projectType,
			String projectAdminMail) {

		this.projectId = projectId;
		this.projectName = projectName;
		this.projectType = projectType;
		ProjectAdminMail = projectAdminMail;
	}

	public int getProjectId() {
		return projectId;
	}

	public void setProjectId(int projectId) {
		this.projectId = projectId;
	}

	public String getProjectName() {
		return projectName;
	}

	public void setProjectName(String projectName) {
		this.projectName = projectName;
	}

	public String getProjectType() {
		return projectType;
	}

	public void setProjectType(String projectType) {
		this.projectType = projectType;
	}

	public String getProjectAdminMail() {
		return ProjectAdminMail;
	}

	public void setProjectAdminMail(String projectAdminMail) {
		ProjectAdminMail = projectAdminMail;
	}

	public void setDevelopers(List<DeveloperDto> developers) {
		this.developers = developers;
	}

	public List<DeveloperDto> getDevelopers() {
		return developers;
	}

}
